package cn.howxu.yichen_ovo.init;

import cn.howxu.yichen_ovo.Res;
import cn.howxu.yichen_ovo.registry.DollRegistryEvent;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

import java.util.Map;

import static cn.howxu.yichen_ovo.YiChenOVO.MODID;

/**
 * @description: TODO
 * @author: HowXu
 * @date: 2025/9/12 18:11
 */
public class ModCreativeTabs {
    
    public static final DeferredRegister<CreativeModeTab> TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);

    public static RegistryObject<CreativeModeTab> HallOfFame_DOLL_TAB = TABS.register("yichen_ovo", () -> CreativeModeTab.builder()
            .title(Component.translatable("item_group.yichen_ovo.name"))
            .icon(() -> ForgeRegistries.ITEMS.getValue( Res.rl("yichen_mm")).getDefaultInstance())
            .displayItems((par, output) -> {
                DollRegistryEvent.ITEMS.forEach(output::accept);
                ModItems.ITEMS.forEach(itemRegistryObject -> output.accept(itemRegistryObject.get()));
                ModItems.BLOCK_ITEMS.forEach(itemRegistryObject -> output.accept(itemRegistryObject.get()));
                ModItems.TABS.forEach(itemRegistryObject -> output.accept(itemRegistryObject.get()));
            }).build());
    
}
